package com.yunyi.exception;

import com.yunyi.response.ResultCode;

/**
 * @ClassName CustomException
 * @Description TODO
 * @Author leizhang
 * Date 2020/6/26 6:42 下午
 * @Version 1.0
 **/
public class CustomException extends RuntimeException {

    //返回码
    private ResultCode resultCode;

    CustomException(ResultCode resultCode) {
        super("错误代码："+resultCode.code()+"错误信息："+resultCode.message());
        this.resultCode = resultCode;
    }
    /**
     * @Description :获取异常码
     * @Author : leizhang
     * @Date 6:45 下午 2020/6/26
     * @param
     * @return com.xuecheng.framework.model.response.ResultCode
     **/
    public ResultCode getResultCode() {
        return this.resultCode;
    }
}
